package pl.lodz.p.browarex.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.stereotype.Repository;

import pl.lodz.p.browarex.model.enums.ClientType;
import pl.lodz.p.browarex.model.enums.State;

@Entity
@PrimaryKeyJoinColumn(name = "USER_ID")
@Table(name = "CUSTOMER")
@Repository
public class Customer extends User {

	// for user
	private String customerID;
	private String name;
	private String surname;
	private String email;
	private Date birthDate;
	private String PESEL;
	private String postalCode;
	private String street;
	private String city;
	private State state;
	private String phoneNumber;
	//for company
	private String comapanyName;
	private String REGON;
	private String NIP;
	
	private ClientType clientType;

	@Column(name = "CUSTOMER_ID_STRING", unique = true, nullable = false)
	public String getCustomerID() {
		return customerID;
	}

	public void setCustomerID(String customerID) {
		this.customerID = customerID;
	}

	@Column(name = "NAME", unique = false)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "SURNAME", unique = false)
	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	@Column(name = "EMAIL", unique = false, nullable = false)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "BIRTHDATE", unique = false)
	@Temporal(TemporalType.DATE)
	public Date getBirthDate() {
		return birthDate;
	}

	public void setBirthDate(Date birthDate) {
		this.birthDate = birthDate;
	}

	@Column(name = "PESEL", unique = true)
	public String getPESEL() {
		return PESEL;
	}

	public void setPESEL(String pESEL) {
		PESEL = pESEL;
	}

	@Column(name = "REGON")
	public String getREGON() {
		return REGON;
	}

	public void setREGON(String rEGON) {
		REGON = rEGON;
	}

	@Column(name = "POSTAL_CODE", unique = false, nullable = false)
	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	@Column(name = "STREET", unique = false, nullable = true)
	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	@Column(name = "CITY", unique = false, nullable = false)
	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Enumerated(EnumType.STRING)
	@Column(name = "STATE", unique = false, nullable = false)
	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}

	@Column(name = "PHONE_NUMBER", unique = false, nullable = true)
	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	
	@Enumerated(EnumType.STRING)
	@Column(name = "CLIENT_TYPE", nullable = false)
	public ClientType getClientType() {
		return clientType;
	}

	public void setClientType(ClientType clientType) {
		this.clientType = clientType;
	}
	@Column(name = "COMPANY_NAME")
	public String getComapanyName() {
		return comapanyName;
	}

	public void setComapanyName(String comapanyName) {
		this.comapanyName = comapanyName;
	}
	@Column(name = "NIP")
	public String getNIP() {
		return NIP;
	}

	public void setNIP(String nIP) {
		NIP = nIP;
	}
	
	

}
